<template>
  <div class="wrapper wrapper-content animated fadeInRight v-cloak" v-cloak>
    <div class="row">
      <div class="form col-md-12">
        <div class="clearfix "></div>
        <div class="col-md-6">
          <div class="form-group clearfix">
            <label class="control-label">反馈标题：</label>
            <div class="col-md-12 form-control">
              {{item.title}}
            </div>
          </div>
          <div class="form-group clearfix">
            <label class="control-label">反馈内容：</label>
            <div class="col-md-12 form-control">
              {{item.content}}
            </div>
          </div>
        </div>
        <div class="col-md-6">
          <div class="form-group clearfix">
            <label class="control-label">反馈人：</label>
            <div class="col-md-12 form-control">
              {{item.createName}}
            </div>
          </div>
          <div class="form-group clearfix">
            <label class="control-label">反馈时间：</label>
            <div class="col-md-12 form-control">
              {{item.dateCreated | date('yyyy-MM-dd HH:mm:ss')}}
            </div>
          </div>
        </div>
        <div class="col-md-12">
          <div class="form-group clearfix">
            <label class="control-label">反馈照片：</label>
            <div class="col-md-12 photos">
              <img v-for="(pic,index) in pics" @click="openFancyBox(pic,'')" :src="pic"/>
            </div>
          </div>
        </div>
        <div class="clearfix "></div>
        <div class="col-12 text-center" style="height: 50px;">
          <div>
            <a @click="lbox.closeMyBoxLayer()" class="btn btn-danger" href="javascript:">返回</a>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script type="text/javascript">
  import '@/assets/css/style.css'

  import axios from 'axios'
  import {apiUtil, site} from '@/assets/js/boss'

  export default {
    data() {
      return {
        item: {},
        pics: []
      }
    },
    mounted() {
      let that = window.$vueApp = this;
      document.getElementsByTagName('body')[0].className = 'fixed-sidebar full-height-layout';
      that.staff.init(function () {
        axios.get(site.feedback.info + sessionStorage.getItem(site.feedback.info), {}).then(function (response) {
          const result = response.data;
          if (result.code === 0) {
            let item = result.data;
            if (apiUtil.notEmpty(item.pics)) {
              that.pics = item.pics.split(',');
            }
            that.item = item;
          } else {
            alert(result.message);
          }
        });
      });
    },
    methods: {}
  }
</script>
